{template "mheader.html"}

<div class="portlet light">
    <div class="portlet-title">
        <div class="caption">
            <span class="caption-subject"> 我的权限</span>
        </div>
    </div>
    <div class="portlet-body">
        <table class="table table-striped table-bordered table-advance ">
            <thead>
            <tr>
                <th width="150">用户组 </th>
                <th width="170">当前级别 </th>
                <th width="170">下级级别 </th>
                <th width="170">升级所需{SITE_EXPERIENCE} </th>
                <th> </th>
            </tr>
            </thead>
            <tbody>
            {loop $ci->member_cache['group'] $gid $t}
            {if $member['groupid'][$gid] && $t['setting']['level']['auto'] && !$t['setting']['level']['unit']}
            {php $next = dr_level_next_value($t.level, $member['levelid'][$gid]);}
            <tr>
                <td class="highlight">
                    <div class="success"></div>
                    <a href="javascript:;"> {$t.name} </a>
                </td>
                <td>{if $t['level']}{$t['level'][$member['levelid'][$gid]]['name']}{else}无{/if}</td>
                <td>{if $next} {$next.name} {else} 无 {/if} </td>
                <td>{if $next} {$next.value} {else} 无 {/if} </td>
                <td>

                    {if $next}
                    {if $t[setting][level][auto]}
                    升级要求:
                    {if $t[setting][level][unit]}
                    消费额{$member.spend} >= {$next.value}
                    {else}
                    {SITE_EXPERIENCE} >= {$next.value}
                    {/if}
                    {else}
                    <a href="{dr_member_url('apply/level', ['gid'=>$gid])}" class="btn green btn-xs "> 我要升级 </a>
                    {/if}
                    {else}
                    已开通
                    {/if}

                </td>
            </tr>
            {/if}
            {/loop}
            </tbody>
        </table>
    </div>
    </div>

<div class="portlet light ">
    <div class="portlet-title tabbable-line">
        <div class="caption">
            <span class="caption-subject"> 升级经验明细 </span>
        </div>
    </div>
    <div class="portlet-body">
        <div class="fc-table-note">
            账户{SITE_EXPERIENCE}：{$member.experience}
        </div>


        <div class="table-scrollable">
            <table class="table table-striped table-bordered table-hover table-checkable dataTable">
                <thead>
                <tr class="heading">
                    <th width="70" class="{dr_sorting('id')}" name="id">流水</th>
                    <th width="150" class="{dr_sorting('inputtime')}" name="inputtime">时间</th>
                    <th width="120" class="{dr_sorting('value')}" name="value" style="padding-left:15px">变动值</th>
                    <th>说明</th>
                </tr>
                </thead>
                <tbody>
                {loop $list $t}
                <tr class="odd gradeX" id="dr_row_{$t.id}">
                    <td>{$t.id}</td>
                    <td>{dr_date($t.inputtime)}</td>
                    <td><b>{dr_pay_money_html($t.value, 0)}</b></td>
                    <td>
                        {if $t.url}
                        <a href="{$t.url}" target="_blank">{$t.note}</a>
                        {else}
                        {$t.note}
                        {/if}
                    </td>
                </tr>
                {/loop}
                </tbody>
            </table>
        </div>

        {if $mypages}
        <div class="fc-pages text-center">{$mypages}</div>
        {/if}
    </div>
</div>



{template "mfooter.html"}